#coding:utf8
cnn = [0.251, 0.252, 0.302, 0.313, 0.403,
 0.422, 0.429, 0.473, 0.501, 0.532,
 0.583, 0.595, 0.651, 0.691, 0.717,
 0.775, 0.808, 0.846, 0.878, 0.932,
 0.941, 0.939, 0.979, 0.981, 0.983,
 0.991, 0.994, 0.988, 0.996, 0.979,
 0.992, 0.999, 0.999, 0.993, 0.992,
 0.993, 0.992, 0.996, 0.999, 0.998, 0.999]

dnn = [0.374, 0.391, 0.405, 0.426, 0.444,
 0.468, 0.488, 0.517, 0.537, 0.572,
 0.604, 0.642, 0.673, 0.715, 0.757,
 0.797, 0.842, 0.878, 0.912, 0.942,
 0.963, 0.980, 0.990, 0.995, 0.999,
 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1]


rnn = [0.357, 0.389, 0.408, 0.423, 0.441,
 0.469, 0.489, 0.509, 0.530, 0.555,
 0.585, 0.639, 0.660, 0.711, 0.741,
 0.764, 0.808, 0.840, 0.885, 0.899,
 0.928, 0.948, 0.966, 0.977, 0.987,
 0.990, 0.995, 0.996, 0.998, 0.998,
 1.0, 1.0, 1.0, 1.0, 1.0,
 1.0, 1.0, 1.0, 1.0, 1.0, 1]

rls = [0.273, 0.28, 0.296, 0.323, 0.345,
  0.370, 0.391, 0.415, 0.426, 0.442,
  0.447,0.47, 0.503, 0.541, 0.589,
  0.626, 0.673, 0.715, 0.751, 0.823,
  0.871, 0.901, 0.934, 0.972, 0.976,
  0.986, 0.997, 1, 1, 1,
  1, 1, 1, 1, 1,
  1, 1, 1, 1, 1,1]

cnn = [1-i for i in cnn]
rnn = [0.96*(1-i) for i in rnn]
dnn = [0.94*(1-i) for i in dnn]
rls = [1-i for i in rls]

x = range(-10, 31)

import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif']=['simhei'] #用来正常显示中文标签

plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
fig = plt.figure()
line_cnn,= plt.plot(x,cnn,'rs-', label='CNN')
line_rnn,= plt.plot(x,rnn,'gv-', label='DNN')
line_dnn,= plt.plot(x,dnn,'bo-', label='RNN')
line_rls,= plt.plot(x,rls,'y^-', label='RLS')
plt.legend([line_cnn,line_rnn,line_dnn,line_rls],['CNN','DNN', 'RNN', 'RLS'])
plt.xlabel(u"信噪比(dB)", fontsize=16)
plt.ylabel(u"误符号率", fontsize=16)
plt.ylim(0,1)
#plt.show()
plt.savefig('dnn_cnn_rnn.png')
